package com.ruoyi.shop.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.PurchaseMapper;
import com.ruoyi.shop.domain.Purchase;
import com.ruoyi.shop.service.IPurchaseService;

/**
 * 进货Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-06
 */
@Service
public class PurchaseServiceImpl implements IPurchaseService 
{
    @Autowired
    private PurchaseMapper purchaseMapper;

    /**
     * 查询进货
     * 
     * @param purchaseId 进货主键
     * @return 进货
     */
    @Override
    public Purchase selectPurchaseByPurchaseId(Long purchaseId)
    {
        return purchaseMapper.selectPurchaseByPurchaseId(purchaseId);
    }

    /**
     * 查询进货列表
     * 
     * @param purchase 进货
     * @return 进货
     */
    @Override
    public List<Purchase> selectPurchaseList(Purchase purchase)
    {
        return purchaseMapper.selectPurchaseList(purchase);
    }

    /**
     * 新增进货
     * 
     * @param purchase 进货
     * @return 结果
     */
    @Override
    public int insertPurchase(Purchase purchase)
    {
        return purchaseMapper.insertPurchase(purchase);
    }

    /**
     * 修改进货
     * 
     * @param purchase 进货
     * @return 结果
     */
    @Override
    public int updatePurchase(Purchase purchase)
    {
        return purchaseMapper.updatePurchase(purchase);
    }

    /**
     * 批量删除进货
     * 
     * @param purchaseIds 需要删除的进货主键
     * @return 结果
     */
    @Override
    public int deletePurchaseByPurchaseIds(Long[] purchaseIds)
    {
        return purchaseMapper.deletePurchaseByPurchaseIds(purchaseIds);
    }

    /**
     * 删除进货信息
     * 
     * @param purchaseId 进货主键
     * @return 结果
     */
    @Override
    public int deletePurchaseByPurchaseId(Long purchaseId)
    {
        return purchaseMapper.deletePurchaseByPurchaseId(purchaseId);
    }
}
